<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@page import="com.liferay.portal.theme.ThemeDisplay"%>
<%@page import="com.liferay.portal.service.LayoutLocalServiceUtil"%>
<%@ page import="com.liferay.portal.kernel.util.WebKeys" %>
<%@ page import="com.liferay.portal.model.User" %>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="com.crossriver.crgis.database.model.Transactions"%>
<%@ include file="/init.jsp"%>

<portlet:defineObjects />
<%
    ThemeDisplay themeDisp = (ThemeDisplay) request
    .getAttribute(WebKeys.THEME_DISPLAY);

      String userId = ""+themeDisp.getUserId();

      User workingUser = UserLocalServiceUtil.getUser(themeDisp.getUserId());
      
      Transactions  trans = (Transactions) request.getAttribute("trans");
 	
 	%>
 	

<div id="main">
	<h1>Payment Status</h1>
  <div class="content"> 
  	<table width="60%" align="center" id="tfee">
  		<tr>
  			<td colspan="2" class="hd"> <img src="${renderRequest.contextPath}/images/1327941476_Stop.png" align="absmiddle"> Transaction was not Successful!</td>
  		</tr>
 
  		<tr>
  			<td width="50%">Dear <strong><%=workingUser.getLastName() %>, 
  			<%=workingUser.getFirstName() %> <%=workingUser.getMiddleName() %> </strong>, your 
  			<br>Transaction Reference Number: </td> <td width="50%"> <strong> 
  			<%=trans.getTransactionRef() %>
  			
  			</strong> </td>
  		</tr>
  		<tr>
  			<td width="50%">Transaction Response: </td> <td width="50%"> <strong> 
  			<%=trans.getResponseDescription() %>
  			</strong> </td>
  		</tr>
   		<tr>
  			<td colspan="2">We are sorry to inform you that the transaction failed with the above exception.</td>
  		</tr>
  		
  		<tr>
  			<td colspan="2">You can easily check your transaction history to check the Transaction Reference # for further references. 
  			You will need to quote this number if you call us for support in respect of this transaction.</td>
  		</tr>
  		
  		<tr>
  			<td colspan="2">
  			<br/>
  			<strong>
  			
  			<liferay-portlet:actionURL name="pickPaymentMode" var="pickPaymentMode"></liferay-portlet:actionURL>
  			
  				<a href="javascript:pickPaymentMode();">
  					Click here to try again.
  				</a>
  			</strong>
  			</td>
  		</tr>
  		
  		
  	</table>
  </div>
</div>

<form name="<portlet:namespace/>pickPaymentMode_fm" method="post"	id="<portlet:namespace/>pickPaymentMode_fm" action="<%=pickPaymentMode.toString()%>">
	<aui:input type="hidden" name="rd" value="Interswich"></aui:input>
</form>

<script type="text/javascript">
<!--
	
	function pickPaymentMode()
	{
		document.forms["<portlet:namespace/>pickPaymentMode_fm"].submit();
	}

//-->
</script>